<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
    
    <style>
        
        p{
            color: red;
            text-align: center;
        }
    </style>
</head>
<body>

<h1>登录界面</h1>
<p>${error}</p>

<form action="${pageContext.request.contextPath}/login" method="post">

    用户名：<input type="text" name="username" value="${param.username}"/><br/>
    密码：<input type="password" name="password"/><br/>
    验证码：<input type="text" name="code" required/>
    <img src="${pageContext.request.contextPath}/imageCode" id="img1">
    <a href="javaScript:void(0)" onclick="huan()">看不清?点击换一张</a>
    <br/>

    <input type="submit" value="登录"/>
</form>

</body>

<script>

    function huan() {
        /*alert("aaa")*/
       var img =  document.getElementById("img1");
       img.src = "${pageContext.request.contextPath}/imageCode?time="+new Date().getTime();
    }
</script>
</html>
